<?php 
function monitor($ip, $port) {   

$onlinetext = "<font color=green>On-Line</font>"; 
$offlinetext = "<font color=red> Off-Line </font>"; 
 
 if(@fsockopen($ip,$port,$errno,$errstr,10)){     
   $monitor=$onlinetext;   
 }
 else{      
   $monitor=$offlinetext;   
 }
 return $monitor;
}
?>

